import { createRouter, createWebHashHistory } from 'vue-router'

export default createRouter({
    history: createWebHashHistory(),

    routes: [
        {
            path: '/',
            redirect: '/home' // 添加重定向配置

        },
        {
            path: '/home',
            name: 'home',
            component: () => import('../views/home/HomeView.vue'),
            children: [
                {
                    path: 'message',
                    name: 'message',
                    component: () => import('../views/home/message/MessageView.vue'),
                },
                {
                    path: 'contact',
                    name: 'contact',
                    component: () => import('../views/home/contact/ContactView.vue')
                },
                {
                    path: 'space',
                    name: 'space',
                    component: () => import('../views/home/space/SpaceView.vue')
                },
                {
                    path: 'notes',
                    name: 'notes',
                    component: () => import('../views/home/notes/NoteView.vue')
                },

            ]
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('../views/login/LoginView.vue')
        },
        {
            path: '/register',
            name: 'register',
            component: () => import('../views/register/RegisterView.vue')
        }
    ]
})
